package com.iatinspur;

import com.iatinspur.pojo.Student;

import java.io.IOException;

import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;

/**
 *  从下向上查找，从上向下加载（双亲委派机制）
 *
 *
 *
 *
 */
public class MyTest {

    public static void main(String[] args) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
        System.out.println(Student.class.getClassLoader());
        URL url = new URL("file:\\D:\\jvmTest\\jvma.jar");
        URL[] urls = new URL[]{url};

        URLClassLoader classLoader1 = new URLClassLoader(urls);

        Class<?> aClass1 = classLoader1.loadClass("com.iatinspur.classloader.Test");
        Object o = aClass1.newInstance();
        System.in.read();

    }





//    public static void main(String[] args) throws ClassNotFoundException {
//        String1 a = new String1();
//    }


}
